package cn.com.hhrcw.personal.wxlogin.util;

import lombok.extern.slf4j.Slf4j;

import java.util.UUID;

/**
 * @author lixingxing
 */
@Slf4j
public class WxLoginTokenUtil {

    public static final String PREFIX = "WX_LOGIN_";

    /**
     * 创建token
     *
     * @return
     */
    public static String createToken() {
        final String token = PREFIX + UUID.randomUUID().toString().replace("-", "").toUpperCase();
        log.info("token:{}", token);
        return token;
    }

    /**
     * 获取对应的userId token
     *
     * @param token
     * @return
     */
    public static String getUserIdToken(String token) {
        final String token2 = token + "_USER_ID";
        return token2;
    }

    /**
     * 获取第三方登录的token
     *
     * @param token
     * @return
     */
    public static String getWxThirdObjToken(String token) {
        final String token2 = token + "_WX_THIRD_OBJ_ID";
        return token2;
    }

}
